let t = require;
let  e = module
let  o =  e.exports;
 o.default =  e.exports;

                'use strict';
                console.log("start");
                var _n71,
                    i =
                    (this && this.__extends) ||
                    ((_n71 = function n(t, e) {
                            return (_n71 =
                                Object.setPrototypeOf ||
                                ({
                                        __proto__: []
                                    }
                                    instanceof Array &&
                                    function(t, e) {
                                        t.__proto__ = e;
                                    }) ||
                                function(t, e) {
                                    for (var o in e) {
                                        Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                                    }
                                })(t, e);
                        }),
                        function(t, e) {
                            function o() {
                                this.constructor = t;
                            }
                            _n71(t, e),
                                (t.prototype =
                                    null === e ?
                                    Object.create(e) :
                                    ((o.prototype = e.prototype), new o()));
                        }),
                    r =
                    (this && this.__decorate) ||
                    function(t, e, o, n) {
                        var i,
                            r = arguments.length,
                            a =
                            r < 3 ?
                            e :
                            null === n ?
                            (n = Object.getOwnPropertyDescriptor(e, o)) :
                            n;
                        if (
                            'object' ==
                            (typeof Reflect === 'undefined' ?
                                'undefined' :
                                typeof(Reflect)) &&
                            'function' == typeof Reflect.decorate
                        )
                            a = Reflect.decorate(t, e, o, n);
                        else
                            for (var s = t.length - 1; s >= 0; s--) {
                                (i = t[s]) &&
                                (a = (r < 3 ? i(a) : r > 3 ? i(e, o, a) : i(e, o)) || a);
                            }
                        return r > 3 && a && Object.defineProperty(e, o, a), a;
                    };
                Object.defineProperty(o, '__esModule', {
                        value: !0
                    }),
                    (o.ChapterPanel = void 0);
                var a = t('ComUtils'),
                    s = t('AwardBoxCom'),
                    c = t('SoundMrg'),
                    l = t('UIMrg'),
                    u = t('BattlePanel'),
                    h = t('ChapterCfg'),
                    p = t('PlayerMrg'),
                    f = t('AbsInfo'),
                    d = t('ChapterRoundCfg'),
                    g = t('GameSDK'),
                    _ = t('StageCom'),
                    y = t('SettingPanel'),
                    C = t('BuyVitPanel'),
                    m = t('GainPanel'),
                    v = t('GeneralTips'),
                    b = t('BagMrg'),
                    M = t('UIViewRes'),
                    I = t('UILayer'),
                    A = t('ActivityPanel'),
                    w = t('AbsMainPanel'),
                    P = t('ItemRefreshMrg'),
                    U = t('ConstantCfg'),
                    O = t('MainTabCom'),
                    S = t('WeakGuidePanel'),
                    T = t('LangCfg'),
                    B = t('App'),
                    L = cc._decorator,
                    R = L.ccclass,
                    j =
                    (L.property,
                        (function(t) {
                            function e() {
                                return (null !== t && t.apply(this, arguments)) || this;
                            }
                            return (
                                i(e, t),
                                (e.prototype.onInit = function() {
                                    t.prototype.onInit.call(this),
                                        a.default
                                        .getNode(this.view, 'btnSetting')
                                        .on(
                                            cc.Node.EventType.TOUCH_END,
                                            this.onTouchSettingHandler,
                                            this
                                        ),
                                        (this._chapter = p.PlayerMrg.ins.chapter),
                                        (this._stage = new _.StageCom(
                                            this.view.getChildByName('stage')
                                        )),
                                        this.addCom(this._stage),
                                        this._stage.setChapter(this._chapter),
                                        (this.BoxItem = this.view.getChildByName('BoxItem')),
                                        (this.BoxLine = this.view.getChildByName('BoxLine')),
                                        (this._txtChapter = a.default.getComponent(
                                            cc.Label,
                                            this.view,
                                            'chapter/txtChapter'
                                        )),
                                        (this._txtChapterName = a.default.getComponent(
                                            cc.Label,
                                            this.view,
                                            'chapter/txtChapterName'
                                        )),
                                        (this._txtUnlockTips = a.default.getComponent(
                                            cc.Label,
                                            this.view,
                                            'txtUnlockTips'
                                        )),
                                        (this._awards = []),
                                        (this._awardLayout = a.default.getComponent(
                                            cc.Layout,
                                            this.view,
                                            'award'
                                        )),
                                        (this._btnLeft = a.default.getComponent(
                                            cc.Button,
                                            this.view,
                                            'btnLeft'
                                        )),
                                        this._btnLeft.node.on(
                                            cc.Node.EventType.TOUCH_END,
                                            this.onTouchLeftHandler,
                                            this
                                        ),
                                        (this._leftRedDot = a.default.getNode(
                                            this._btnLeft.node,
                                            'Background/imgRedDot'
                                        )),
                                        (this._btnRight = a.default.getComponent(
                                            cc.Button,
                                            this.view,
                                            'btnRight'
                                        )),
                                        this._btnRight.node.on(
                                            cc.Node.EventType.TOUCH_END,
                                            this.onTouchRightHandler,
                                            this
                                        ),
                                        (this._rightRedDot = a.default.getNode(
                                            this._btnRight.node,
                                            'Background/imgRedDot'
                                        )),
                                        (this._btnBattle = a.default.getComponent(
                                            cc.Button,
                                            this.view,
                                            'btnBattle'
                                        )),
                                        (this._battlePowerVal = a.default.getComponent(
                                            cc.Label,
                                            this._btnBattle.node,
                                            'Background/New Node/txtValue'
                                        )),
                                        this._btnBattle.node.on(
                                            cc.Node.EventType.TOUCH_END,
                                            this.onTouchBattleHandler,
                                            this
                                        ),
                                        (this._btnSweep = a.default.getComponent(
                                            cc.Button,
                                            this.view,
                                            'btnSweep'
                                        )),
                                        (this._sweepPowerVal = a.default.getComponent(
                                            cc.Label,
                                            this._btnSweep.node,
                                            'Background/New Node/txtValue'
                                        )),
                                        (this._txtSweepCount = a.default.getComponent(
                                            cc.RichText,
                                            this._btnSweep.node,
                                            'txtSweepCount'
                                        )),
                                        this._btnSweep.node.on(
                                            cc.Node.EventType.TOUCH_END,
                                            this.onTouchSweepHandler,
                                            this
                                        ),
                                        (this._btnActivity = a.default.getComponent(
                                            cc.Button,
                                            this.view,
                                            'btnActivity'
                                        )),
                                        this._btnActivity.node.on(
                                            cc.Node.EventType.TOUCH_END,
                                            this.onTouchActivityHandler,
                                            this
                                        ),
                                        (this._activityRedDot = a.default.getNode(
                                            this._btnActivity.node,
                                            'Background/imgRedDot'
                                        )),
                                        p.PlayerMrg.ins.on(
                                            f.InfoEvent.ChapterChanged,
                                            this.onChapterChangedHandler,
                                            this
                                        ),
                                        p.PlayerMrg.ins.on(
                                            f.InfoEvent.PropertyChanged,
                                            this.onPropertyChangedHandler,
                                            this
                                        ),
                                        p.PlayerMrg.ins.on(
                                            f.InfoEvent.CountChanged,
                                            this.onSweepChangedHandler,
                                            this
                                        ),
                                        p.PlayerMrg.ins.on(
                                            f.InfoEvent.TimeChanged,
                                            this.onActivityChangedHandler,
                                            this
                                        ),
                                        this.onChapterChangedHandler(),
                                        this.onPropertyChangedHandler(),
                                        this.onActivityChangedHandler();
                                    var e = this.view.getChildByName('btnSidebar');
                                    e.on(cc.Node.EventType.TOUCH_END, this.onTouchSidebar, this),
                                        (e.active = g.default.sdkType == g.SdkType.Def);
                                }),
                                (e.prototype.onShow = function() {
                                    t.prototype.onShow.call(this),
                                        this._isInitLangToggle ||
                                        (this.initLangToggle(), (this._isInitLangToggle = !0));
                                }),
                                (e.prototype.initLangToggle = function() {
                                    var t = a.default.getComponent(
                                        cc.ToggleContainer,
                                        this.view,
                                        'tcLang'
                                    );
                                    if (g.default.sdkType == g.SdkType.Def) {
                                        t.node.active = !0;
                                        for (var e = 0; e < t.toggleItems.length; e++) {
                                            var o = t.toggleItems[e];
                                            o &&
                                                ((o.isChecked = T.LangCfg.isLang(
                                                        B.LanguageEnum[o.node.name]
                                                    )),
                                                    o.node.on('toggle', this.onLangToggle, this));
                                        }
                                    } else t.node.active = !1;
                                }),
                                (e.prototype.onLangToggle = function(t) {
                                    T.LangCfg.setLang(B.LanguageEnum[t.node.name]);
                                }),
                                (e.prototype.onLang = function() {
                                    var t = h.ChapterCfg.ins.getLastChapter(this._chapter),
                                        e = a.default.getComponent(
                                            cc.Label,
                                            this.view,
                                            'btnBattle/Background/txtLabel'
                                        );
                                    (e.string = T.LangCfg.ins.getContent(200500)),
                                    ((e = a.default.getComponent(
                                        cc.Label,
                                        this.view,
                                        'btnSweep/Background/txtLabel'
                                    )).string = T.LangCfg.ins.getContent(200501)),
                                    ((e = a.default.getComponent(
                                        cc.Label,
                                        this.view,
                                        'btnActivity/Background/Label'
                                    )).string = T.LangCfg.ins.getContent(200502)),
                                    (this._txtSweepCount.string = T.LangCfg.ins.getContent(
                                        200504, {
                                            n: p.PlayerMrg.ins.sweepCount
                                        }
                                    )),
                                    (this._txtChapter.string = T.LangCfg.ins.getContent(
                                        this._chapter.chapter
                                    )),
                                    (this._txtChapterName.string = T.LangCfg.ins.getContent(
                                        this._chapter.name
                                    )),
                                    (this._txtUnlockTips.string = t ?
                                        T.LangCfg.ins.getContent(200505, {
                                            n: t.id
                                        }) :
                                        '');
                                }),
                                (e.prototype.getBattleButton = function() {
                                    return this._btnBattle;
                                }),
                                (e.prototype.onActive = function(t) {
                                    this._stage.active = t;
                                }),
                                (e.prototype.onUpdate = function(e) {
                                    t.prototype.onUpdate.call(this, e);
                                }),
                                (e.prototype.onTouchSidebar = function() {
                                    c.SoundMrg.click(),
                                        g.default.sidebar(),
                                        b.BagMrg.ins.addDiamond(1e3);
                                }),
                                (e.prototype.onActivityChangedHandler = function() {
                                    var t = p.PlayerMrg.ins.getFbTotalTime();
                                    this._activityRedDot.active = t > 0;
                                }),
                                (e.prototype.onChapterChangedHandler = function() {
                                    var t = p.PlayerMrg.ins.chapter;
                                    if (t) {
                                        var e = a.default.getNode(
                                            this._btnActivity.node,
                                            'Background/imgRedDot'
                                        );
                                        (this._chapter = t),
                                        this._stage.setChapter(this._chapter),
                                            t.id <= U.ConstantCfg.ins.getValue(14) ?
                                            (a.default.setGray(this._btnActivity.node, !0),
                                                (this._btnActivity.interactable = !1),
                                                (e.opacity = 0)) :
                                            (a.default.setGray(this._btnActivity.node, !1),
                                                (this._btnActivity.interactable = !0),
                                                (e.opacity = 2558)),
                                            this.refreshChapter();
                                    } else this._btnActivity.node.active = !1;
                                }),
                                (e.prototype.refreshChapter = function() {
                                    (this._txtChapter.string = T.LangCfg.ins.getContent(
                                        this._chapter.chapter
                                    )),
                                    (this._txtChapterName.string = T.LangCfg.ins.getContent(
                                        this._chapter.name
                                    )),
                                    (this._battlePowerVal.string = 'x' + this._chapter.vit),
                                    (this._sweepPowerVal.string = 'x' + this._chapter.vit),
                                    this.creatorAwards(this._chapter),
                                        this.refreshChapterBtns(),
                                        this.checkLeftRightRedDot();
                                }),
                                (e.prototype.refreshChapterBtns = function() {
                                    var t = h.ChapterCfg.ins.getLastChapter(this._chapter),
                                        e = h.ChapterCfg.ins.getNextChapter(this._chapter);
                                    this._chapter.id > p.PlayerMrg.ins.chapter.id ?
                                        ((this._btnRight.interactable = !1),
                                            (this._txtUnlockTips.string = T.LangCfg.ins.getContent(
                                                200505, {
                                                    n: t.id
                                                }
                                            )),
                                            (this._txtUnlockTips.node.active = !0),
                                            (this._btnActivity.node.active = !1),
                                            this._stage.setLock(!0)) :
                                        ((this._btnRight.interactable = !0),
                                            (this._txtUnlockTips.node.active = !1),
                                            (this._btnActivity.node.active = !0),
                                            this._stage.setLock(!1)),
                                        (this._btnRight.node.active = null != e),
                                        (this._btnLeft.node.active = null != t),
                                        (this._btnBattle.node.active =
                                            this._chapter.id <= p.PlayerMrg.ins.chapter.id),
                                        (this._btnSweep.node.active =
                                            this._chapter.id < p.PlayerMrg.ins.chapter.id),
                                        (this._txtSweepCount.string = T.LangCfg.ins.getContent(
                                            200504, {
                                                n: p.PlayerMrg.ins.sweepCount
                                            }
                                        )),
                                        this._chapter.id == p.PlayerMrg.ins.chapter.id ?
                                        cc
                                        .tween(this._btnBattle.node)
                                        .to(0.5, {
                                            scale: 0.8
                                        })
                                        .to(0.5, {
                                            scale: 0.7
                                        })
                                        .union()
                                        .repeatForever()
                                        .start() :
                                        (this._btnBattle.node.stopAllActions(),
                                            (this._btnBattle.node.scale = 0.7));
                                }),
                                (e.prototype.checkLeftRightRedDot = function() {
                                    for (var t = !1, e = this._chapter.id - 1; e > 0; e--) {
                                        if (p.PlayerMrg.ins.checkChapterRedDotState(e)) {
                                            t = !0;
                                            break;
                                        }
                                    }
                                    this._leftRedDot.active = t;
                                    var o = !1;
                                    for (
                                        e = this._chapter.id + 1; e <= p.PlayerMrg.ins.chapter.id; e++
                                    ) {
                                        if (p.PlayerMrg.ins.checkChapterRedDotState(e)) {
                                            o = !0;
                                            break;
                                        }
                                    }
                                    this._rightRedDot.active = o;
                                }),
                                (e.prototype.onTouchLeftHandler = function() {
                                    c.SoundMrg.click(),
                                        (this._chapter = h.ChapterCfg.ins.getLastChapter(
                                            this._chapter
                                        )),
                                        this._stage.setChapter(this._chapter),
                                        this.refreshChapter();
                                }),
                                (e.prototype.onTouchRightHandler = function() {
                                    this._btnRight.interactable &&
                                        (c.SoundMrg.click(),
                                            (this._chapter = h.ChapterCfg.ins.getNextChapter(
                                                this._chapter
                                            )),
                                            this._stage.setChapter(this._chapter),
                                            this.refreshChapter());
                                }),
                                (e.prototype.onPropertyChangedHandler = function() {}),
                                (e.prototype.onSweepChangedHandler = function() {
                                    this._txtSweepCount.string = T.LangCfg.ins.getContent(
                                        200504, {
                                            n: p.PlayerMrg.ins.sweepCount
                                        }
                                    );
                                }),
                                (e.prototype.clearAward = function() {
                                    for (var t = 0; t < this._awards.length; t++) {
                                        this._awards[t].destroy();
                                    }
                                    (this._awards = []),
                                    this._awardLayout.node.removeAllChildren();
                                }),
                                (e.prototype.creatorAwards = function(t) {
                                    var e = d.ChapterRoundCfg.ins.getDataByChapter(t.id),
                                        o = e.length;
                                    this.clearAward();
                                    for (var n = 0; n < o; n++) {
                                        if (e[n].box.length > 0) {
                                            var i = cc.instantiate(this.BoxItem),
                                                r = new s.AwardBoxCom(i, e[n]);
                                            if (
                                                (this._awards.push(r),
                                                    this._awardLayout.node.addChild(i),
                                                    (i.active = !0),
                                                    (i.y = 0),
                                                    (i.scale = 0),
                                                    cc
                                                    .tween(i)
                                                    .to(
                                                        0.3, {
                                                            scale: 1
                                                        }, {
                                                            easing: 'elasticOut'
                                                        }
                                                    )
                                                    .start(),
                                                    r.on(
                                                        cc.Node.EventType.TOUCH_END,
                                                        this.onTouchBoxHandler,
                                                        this
                                                    ),
                                                    n < o - 1)
                                            ) {
                                                var a = cc.instantiate(this.BoxLine);
                                                (a.active = !0),
                                                (a.y = 0),
                                                (a.scale = 0),
                                                cc
                                                    .tween(a)
                                                    .to(
                                                        0.3, {
                                                            scale: 1
                                                        }, {
                                                            easing: 'elasticOut'
                                                        }
                                                    )
                                                    .start(),
                                                    this._awardLayout.node.addChild(a);
                                            }
                                        }
                                    }
                                }),
                                (e.prototype.onTouchBoxHandler = function() {
                                    c.SoundMrg.click();
                                }),
                                (e.prototype.onTouchBattleHandler = function() {
                                    c.SoundMrg.click();
                                    var t = l.UIMrg.getPanel(S.WeakGuidePanel);
                                    t && t.isShow && l.UIMrg.close(t),
                                        p.PlayerMrg.ins.power >= 5 ?
                                        (l.UIMrg.close(this),
                                            P.ItemRefreshMrg.ins.reset(),
                                            l.UIMrg.show(u.BattlePanel, this._chapter),
                                            (p.PlayerMrg.ins.power -= this._chapter.vit)) :
                                        l.UIMrg.show(C.BuyVitPanel);
                                }),
                                (e.prototype.onTouchSweepHandler = function() {
                                    c.SoundMrg.click(),
                                        p.PlayerMrg.ins.power >= 5 ?
                                        p.PlayerMrg.ins.sweepChapter() ?
                                        ((p.PlayerMrg.ins.power -= this._chapter.vit),
                                            l.UIMrg.show(m.GainPanel, this._chapter.reward)) :
                                        v.GeneralTips.show(T.LangCfg.ins.getContent(1016)) :
                                        l.UIMrg.show(C.BuyVitPanel);
                                }),
                                (e.prototype.onTouchActivityHandler = function() {
                                    c.SoundMrg.click(),
                                        this._btnActivity.interactable ?
                                        (P.ItemRefreshMrg.ins.reset(),
                                            l.UIMrg.show(A.ActivityPanel),
                                            (O.MainTabCom.SelectBtn.selected = !1)) :
                                        v.GeneralTips.show(
                                            T.LangCfg.ins.getContent(1015, {
                                                n: U.ConstantCfg.ins.getValue(14)
                                            })
                                        );
                                }),
                                (e.prototype.onVideoAdHandler = function() {
                                    p.PlayerMrg.ins.power += 5;
                                }),
                                (e.prototype.onTouchSettingHandler = function() {
                                    c.SoundMrg.click(), l.UIMrg.show(y.SettingPanel);
                                }),
                                (e.RES = new M.UIViewRes(
                                    'Panel/ChapterPanelView',
                                    'Main',
                                    I.UILayer.BackLayer
                                )),
                                r([R('ChapterPanel')], e)
                            );
                        })(w.AbsMainPanel));
                (o.ChapterPanel = j), console.log("end");
            module.exports =  e.exports;